home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 April: Mac OS SDK / Dev.CD Apr 99 SDK1.toast / Development Kits / Interfaces&Libraries / Universal / Interfaces / CIncludes / OSAGeneric.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-08-17  |  3.7 KB  |  136 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        OSAGeneric.h
  3.  
  4.      Contains:    AppleScript Generic Component Interfaces.
  5.  
  6.      Version:    Technology:    AppleScript 1.1
  7.                  Release:    Universal Interfaces 3.2
  8.  
  9.      Copyright:    © 1992-1998 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __OSAGENERIC__
  18. #define __OSAGENERIC__
  19.  
  20. #ifndef __ERRORS__
  21. #include <Errors.h>
  22. #endif
  23. #ifndef __APPLEEVENTS__
  24. #include <AppleEvents.h>
  25. #endif
  26. #ifndef __OSA__
  27. #include <OSA.h>
  28. #endif
  29.  
  30.  
  31.  
  32. #if PRAGMA_ONCE
  33. #pragma once
  34. #endif
  35.  
  36. #ifdef __cplusplus
  37. extern "C" {
  38. #endif
  39.  
  40. #if PRAGMA_IMPORT
  41. #pragma import on
  42. #endif
  43.  
  44. #if PRAGMA_STRUCT_ALIGN
  45.     #pragma options align=mac68k
  46. #elif PRAGMA_STRUCT_PACKPUSH
  47.     #pragma pack(push, 2)
  48. #elif PRAGMA_STRUCT_PACK
  49.     #pragma pack(2)
  50. #endif
  51.  
  52. /*     NOTE:    This interface defines a "generic scripting component."
  53.             The Generic Scripting Component allows automatic dispatch to a
  54.             specific scripting component that conforms to the OSA interface.
  55.             This component supports OSA, by calling AppleScript or some other 
  56.             scripting component.  Additionally it provides access to the default
  57.             and the user-prefered scripting component.
  58. */
  59.  
  60.  
  61.  
  62. enum {
  63.                                                                 /* Component version this header file describes */
  64.     kGenericComponentVersion    = 0x0100
  65. };
  66.  
  67.  
  68. enum {
  69.     kGSSSelectGetDefaultScriptingComponent = 0x1001,
  70.     kGSSSelectSetDefaultScriptingComponent = 0x1002,
  71.     kGSSSelectGetScriptingComponent = 0x1003,
  72.     kGSSSelectGetScriptingComponentFromStored = 0x1004,
  73.     kGSSSelectGenericToRealID    = 0x1005,
  74.     kGSSSelectRealToGenericID    = 0x1006,
  75.     kGSSSelectOutOfRange        = 0x1007
  76. };
  77.  
  78. typedef OSType                             ScriptingComponentSelector;
  79. typedef OSAID                             GenericID;
  80. /* get and set the default scripting component */
  81. EXTERN_API( OSAError )
  82. OSAGetDefaultScriptingComponent    (ComponentInstance         genericScriptingComponent,
  83.                                  ScriptingComponentSelector * scriptingSubType)                FIVEWORDINLINE(0x2F3C, 0x0004, 0x1001, 0x7000, 0xA82A);
  84.  
  85. EXTERN_API( OSAError )
  86. OSASetDefaultScriptingComponent    (ComponentInstance         genericScriptingComponent,
  87.                                  ScriptingComponentSelector  scriptingSubType)                FIVEWORDINLINE(0x2F3C, 0x0004, 0x1002, 0x7000, 0xA82A);
  88.  
  89. /* get a scripting component instance from its subtype code */
  90. EXTERN_API( OSAError )
  91. OSAGetScriptingComponent        (ComponentInstance         genericScriptingComponent,
  92.                                  ScriptingComponentSelector  scriptingSubType,
  93.                                  ComponentInstance *    scriptingInstance)                    FIVEWORDINLINE(0x2F3C, 0x0008, 0x1003, 0x7000, 0xA82A);
  94.  
  95. /* get a scripting component selector (subType) from a stored script */
  96. EXTERN_API( OSAError )
  97. OSAGetScriptingComponentFromStored (ComponentInstance     genericScriptingComponent,
  98.                                  const AEDesc *            scriptData,
  99.                                  ScriptingComponentSelector * scriptingSubType)                FIVEWORDINLINE(0x2F3C, 0x0008, 0x1004, 0x7000, 0xA82A);
  100.  
  101. /* get a real component instance and script id from a generic id */
  102. EXTERN_API( OSAError )
  103. OSAGenericToRealID                (ComponentInstance         genericScriptingComponent,
  104.                                  OSAID *                theScriptID,
  105.                                  ComponentInstance *    theExactComponent)                    FIVEWORDINLINE(0x2F3C, 0x0008, 0x1005, 0x7000, 0xA82A);
  106.  
  107. /* get a generic id from a real component instance and script id */
  108. EXTERN_API( OSAError )
  109. OSARealToGenericID                (ComponentInstance         genericScriptingComponent,
  110.                                  OSAID *                theScriptID,
  111.                                  ComponentInstance         theExactComponent)                    FIVEWORDINLINE(0x2F3C, 0x0008, 0x1006, 0x7000, 0xA82A);
  112.  
  113.  
  114.  
  115.  
  116. #if PRAGMA_STRUCT_ALIGN
  117.     #pragma options align=reset
  118. #elif PRAGMA_STRUCT_PACKPUSH
  119.     #pragma pack(pop)
  120. #elif PRAGMA_STRUCT_PACK
  121.     #pragma pack()
  122. #endif
  123.  
  124. #ifdef PRAGMA_IMPORT_OFF
  125. #pragma import off
  126. #elif PRAGMA_IMPORT
  127. #pragma import reset
  128. #endif
  129.  
  130. #ifdef __cplusplus
  131. }
  132. #endif
  133.  
  134. #endif /* __OSAGENERIC__ */
  135.  
  136.